<%--
  Created by IntelliJ IDEA.
  User: Xun
  Date: 2015/5/25
  Time: 18:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<span id="showContent">123</span>
<script language="javascript" type="text/javascript">

    var xmlHttp = false;
    if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlHttp = new XMLHttpRequest();
    }
    else { // code for IE6, IE5
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    function sendMsg() {
        var url = "/drrr/getChatHistories.action";
        xmlHttp.open("GET", url, true);
        alert("update qian");
        xmlHttp.onreadystatechange = updatePage;
        alert("update hou");
        xmlHttp.send(null);
    }

    function updatePage() {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var response = xmlHttp.responseText;
            alert(response);
            document.getElementById("showContent").innerHTML = response;
        }
    }
</script>
</body>
</html>
